﻿//************************************************************************************************
// Copyright © 2012 Steven M. Cohn. All Rights Reserved.
//
//************************************************************************************************

namespace CookieChipper
{
	using System;


	/// <summary>
	/// Represents information about the current cookie cache
	/// </summary>
	
	internal class CacheHeader
	{
		public CacheHeader (string path)
		{
			this.Path = path;
			this.HashTables = 1;
		}


		/// <summary>
		/// Gets or sets the number of allocated (used) blocks in the file.
		/// </summary>
		/// <remarks>
		/// AllocatedBlocks / BlockSize(128) = Bytes ... / 1028 = KB
		/// </remarks>

		public int AllocatedBlocks { get; set; }


		/// <summary>
		/// Gets or sets the maximum quota (growth size) allowed for the cache.
		/// </summary>
		/// <remarks>
		/// CacheQuota / 1024 = KB
		/// </remarks>

		public int CacheQuota { get; set; }


		/// <summary>
		/// Gets or sets the total number of bytes used within the cache.
		/// </summary>
		/// <remarks>
		/// CacheSize / 1024 = KB
		/// </remarks>

		public int CacheSize { get; set; }


		/// <summary>
		/// Gets or sets the total size of the cache file in bytes.
		/// </summary>
		/// <remarks>
		/// FileSize / 1024 = KB
		/// </remarks>

		public int FileSize { get; set; }


		/// <summary>
		/// Gets or sets the total number of blocks in all hash tables in the index file.
		/// </summary>

		public int HashBlocks { get; set; }


		/// <summary>
		/// Gets or sets the offset of first hash table.
		/// </summary>
		/// <remarks>
		/// For internal use; not for display in info panel.
		/// </remarks>

		public int HashTableOffset { get; set; }


		/// <summary>
		/// Gets or sets the number of hash tables in the index file.
		/// </summary>

		public int HashTables { get; set; }


		/// <summary>
		/// Gets the path of the cache file.
		/// </summary>

		public string Path { get; private set; }


		/// <summary>
		/// Gets or sets the number of valid record entries available in the cache.
		/// </summary>

		public int Records { get; set; }


		/// <summary>
		/// Gets or sets the version signature of the cache.
		/// </summary>

		public string Signature { get; set; }


		/// <summary>
		/// Gets or sets the total number of blocks allocated in the cache file.
		/// </summary>

		public int TotalBlocks { get; set; }
	}
}
